<template>
    <div class="banners">

        <img src="../../assets/official/u6427.png" alt="" class="img">

        <div class="backBox">
            <div class="backTitle">
                <div class="title-Back">
                    <img src="../../assets/official/u6431.png" alt="" class="doctorImg">
                </div>
            </div>
            <div class="back">

                <div class="titleBtn">
                    <p class="fontWeight">四川省保健院</p>
                    <div class="backText">三甲</div>
                </div>
                <div class="p14">
                    <p class="font_14_1">简介:</p>
                    <p class="font_14_2">
                        <van-text-ellipsis rows="3" :content="text" expand-text="展开" @click-action="toActions" />

                    </p>
                </div>
                <hr />
                <div class="u6438">
                    <p class="font14">四川省成都市武侯区武侯大道</p>
                    <div class="u6439_div">
                        <img class="u6439_img"
                            src="https://cdn7.axureshop.com/demo/2208121/images/%E5%BE%AE%E5%AE%98%E7%BD%91/u6439.svg"
                            alt="">
                        <span>|</span>
                        <img class="u6439_img"
                            src="https://cdn7.axureshop.com/demo/2208121/images/%E5%BE%AE%E5%AE%98%E7%BD%91/u6441.svg"
                            alt="">
                    </div>
                </div>
            </div>
        </div>




    </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';


const text = ref('四川省保健院是一所以急救医学、耳鼻喉专业学科为特色，融医疗、教学、科研、预防、保健为一体的综合性三级甲等医院四川省保健院是一所以急救医学、耳鼻喉专业学科为特色，融医疗、教学、科研、预防、保健为一体的综合性三级甲等医院')
const router = useRouter()

const toActions = () => {
    router.push({
        name: 'introduce'
    })
}

// let containerWidth = ref(0) //主要代码
// let containerHeight = ref(0) //主要代码

// onMounted(() => {
//     updateContainerSize()
//     window.addEventListener("resize", updateContainerSize);
// })

// const imageStyle = () => {
//     return {
//         maxWidth: containerWidth.value + 'px',
//         maxHeight: containerHeight.value + 'px',
//         width: "375px",
//         height: "191px"
//     }
// }

// const updateContainerSize = () => {
//     containerWidth.value = window.innerWidth * 0.8
//     containerHeight.value = window.innerHeight * 0.8

// }

// console.log(imageStyle)

// onDestroyed(() => {
//     window.removeEventListener("resize", updateContainerSize)
// })


</script>

<style lang="scss" scoped>
.banners {
    width: 100%;
    min-height: 300px;
    position: relative;

    .img {
        width: 100%;
        height: 192px;
        // display: block;
        // width: 100%;
        // max-height: 100%;

    }

    .backBox {
        width: 100%;
        height: 176px;
        padding: 0 16px;
        box-sizing: border-box;
        position: absolute;
        bottom: 0;

        .backTitle {
            position: absolute;
            top: -35px;
            left: 30px;

            .title-Back {
                width: 65px;
                height: 65px;
                background-color: #fff;
                border-radius: 50%;
                display: flex;
                justify-content: center;
                align-items: center;

                .doctorImg {
                    width: 44px;
                }
            }

            .title-box {
                width: 65px;
                height: 30px;
                background-color: #ff9900;
                border-radius: 8px;
                display: flex;
                justify-content: center;
                align-items: center;
                color: #fff;
                font-size: 12px;
                margin-top: 10px;
            }
        }

        .back {
            width: 100%;
            height: 176px;
            background-color: #fafafa;
            border-radius: 8px;
            padding: 4px 16px;
            box-sizing: border-box;
            background-image: url(https://cdn7.axureshop.com/demo/2208121/images/%E5%BE%AE%E5%AE%98%E7%BD%91/u6428.svg);

            .titleBtn {
                display: flex;
                // justify-content: space-between;

                justify-content: center;
                align-items: center;
                gap: 8px;
                padding-left: 16px;

                .backText {
                    width: 50px;
                    height: 19px;
                    background-color: transparent;
                    border: 1px solid #36CFC9;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: #36CFC9;
                    font-size: 12px;
                    margin-top: 10px;
                }
            }

            .p14 {
                display: flex;
                gap: 14px;
                padding: 12px 0 12px 0;


                .font_14_1 {
                    width: 50px;
                    height: 20px;
                    font-family: PingFang SC;
                    font-weight: 400;
                    line-height: 20px;
                    font-size: 14px;
                }

                .font_14_2 {
                    width: 413px;
                    // height: 20px;
                    font-family: PingFang SC;
                    font-weight: 400;
                    line-height: 20px;
                    font-size: 12px;
                    // width: 200px;
                    /* 限制容器宽度 */
                    display: -webkit-box;
                    /* 设置为WebKit内核的弹性盒子模型 */
                    -webkit-box-orient: vertical;
                    /* 垂直排列 */
                    -webkit-line-clamp: 3;
                    /* 限制显示三行 */
                    overflow: hidden;
                    /* 隐藏超出范围的内容 */
                    text-overflow: ellipsis;
                    /* 使用省略号 */

                }
            }

            .u6438 {
                padding-top: 12px;
                display: flex;
                justify-content: space-between;

                .u6439_div {
                    display: flex;
                    align-items: center;
                    gap: 8px;

                    .u6439_img {
                        width: 20px;
                        height: 20px;
                    }
                }
            }
        }
    }
}

.lineh {
    width: 100%;
    line-height: 20px;
    height: 60px;
    overflow: hidden;
}
</style>